@php
$oneDay=\App\User::where('created_at','>',\Carbon\Carbon::yesterday())->count('id');
$threeDay=\App\User::where('created_at','>',\Illuminate\Support\Carbon::today()->addDays(-3))->count('id');
$sevenDay=\App\User::where('created_at','>',\Illuminate\Support\Carbon::today()->addDays(-7))->count('id');
$mouth=\App\User::where('created_at','>',\Illuminate\Support\Carbon::today()->addDays(-30))->count('id');
$total=\App\User::count('id');
$var= json_encode([$oneDay,$threeDay,$sevenDay,$mouth,$total]);
Admin::js("/js/Chart.min.js");
@endphp
<div id="user" width="600" style="width: 600px;height:400px;"></div>
<script>

    $(function () {
        var data ={{$var}};
        var myChart1 = echarts.init(document.getElementById('user'));
        var option = {
            title: {
                text: '会员注册统计'
            },
            tooltip: {},
            legend: {
                data: ['注册会员数']
            },
            xAxis: {
                data: ["前一天","前三天","前七天", "前三十天", '当前']
            },
            yAxis: {},
            series: [{
                name: '注册会员数',
                type: 'bar',
                data: data
            }],
            color:['#3c8dbc']
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart1.setOption(option);
    })
</script>